package com.EpidemicPrevention.service;

import com.EpidemicPrevention.mapper.StudyroomMapper;
import com.EpidemicPrevention.pojo.Studyroom;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class StudyroomServiceImpl implements StudyroomService {

    @Autowired
    private StudyroomMapper studyroomMapper;

    @Override

    public JSON saveStudyroom (Studyroom studyroom) {
        JSONObject json = new JSONObject();
        int code = 0;
        code = studyroomMapper.saveStudyroom(studyroom);
        if (code == 1) {
            json.put("code", 1);
            json.put("msg", "保存成功");
        } else {
            json.put("code", 0);
            json.put("msg", "保存失败");
        }
        return json;
    }
}
